<%@ page language="java" pageEncoding="UTF-8" trimDirectiveWhitespaces="true" %>
 <%@include file="include/jspheader.jsp" %>
 
 <html>
 <body>
<div id="Mainbody">
 
  <%@include file="include/top.jsp" %>
   
         
   <h1><img src="<%=request.getContextPath()%>/images/signuplogo.png" width="233" height="37" /></h1>
   <div id="LoginBox">
   <div class="left" style="float:right;">
		<h2>可用以下账号直接登录</h2>
        <div id="outlink">
            <a href="#"><img src="<%=request.getContextPath()%>/images/xinlang.gif" width="62" height="62" /></a>
            <a href="#"><img src="<%=request.getContextPath()%>/images/tengxunqq.gif" width="62" height="62" /></a>
            <a href="#"><img src="<%=request.getContextPath()%>/images/douban.gif" width="62" height="62" /></a>
            <a href="#"><img src="<%=request.getContextPath()%>/images/renren.gif" width="62" height="62" /></a>
            <div class="clear"></div>
        </div>
		<span>已有账号? &nbsp;<a href="<%=request.getContextPath()%>/user/doViewLogin.action" class="green">立即登录</a></span>
   </div>
    <div class="right" style="float:left;">
    <form action="<%=request.getContextPath()%>/user/doRegister.action" method="post" id="register">
      <table border="0" cellspacing="0" cellpadding="0" id="LoginTable">
        <tr>
        <th align="left">
        <span>用户名：</span>
        <input   type="text" id="username" name="epowerUser.username" />
        <div id="usernameTip"></div>
		</th>
        </tr>
        <tr>
        <th align="left">
        <span>邮箱：</span>
        <input type="text"   id="mail"  name="epowerUser.mail" />
        <div id="mailTip"></div>
         </th>
        </tr>
        <tr>
        <th align="left">
        <span>密码：</span>
        <input type="password"   id="password"  name="epowerUser.password" />
        <div id="passwordTip"></div>
         </th>
        </tr>
        <tr>
        <th align="left">
        <span>重复密码：</span>
        <input type="password"   id="repassword" name="epowerUser.repassword" />
        <div id="repasswordTip"></div>
         </th>
        </tr>
        <tr>
        <td align="left" class="red"><s:property value="errMsg"/></td>
        </tr>
        <tr>
        <td align="left"><input type="submit" name="button" id="button" value="注册" class="bott2"/></td>
        </tr>
        </table>
                <script language="javaScript">
$(document).ready(function(){
	initValidator();
});
function initValidator(){
	$.formValidator.initConfig({formid:"register",onerror:function(msg){alert(msg);}});
	$('#username').formValidator({onshow:"请输入用户名",onfocus:"请输入用户名",oncorrect:"输入正确"}).functionValidator({fun:function(val,elem){$(elem).val($.trim(val))}}).inputValidator({min:5,max:30,onerror:"用户名5~30个字符"});
	$('#mail').formValidator({onshow:"请输入邮箱",onfocus:"请输入邮箱",oncorrect:"输入正确"}).inputValidator({min:5,max:30,onerror:"邮箱5~30个字符"}).functionValidator({
		  fun:function(val,elem){
		  $(elem).val($.trim(val));
		  if(val.indexOf("@")==-1){
		  return "您的邮箱格式不规范!";
		  }
		  if(val.indexOf(".com")==-1){
		  return "您的邮箱格式不规范!";
		  }
		  return true;
		  }
	});
	$('#password').formValidator({onshow:"请输入密码",onfocus:"请输入密码",oncorrect:""}).functionValidator({fun:function(val,elem){$(elem).val($.trim(val))}}).inputValidator({min:5,max:30,onerror:"密码最少5个字符"});
	$('#repassword').formValidator({onshow:"请重新输入密码",onfocus:"请重新输入密码",oncorrect:""}).functionValidator({fun:function(val,elem){$(elem).val($.trim(val))}}).inputValidator({min:5,max:30,onerror:"密码最少5个字符"}).functionValidator({
		  fun:function(val,elem){
	     var pass=$("#overtime").val();	
	     if(pass!=val){
	     return "两次输入的密码不一致";
	     }
		  return true;
		  }
	});
}
</script>
    </form>
    </div>
    
   <div class="clear"></div>
   </div>
 
    <%@include file="include/footer.jsp" %>
</div>
</body>
</html>
